<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
<script>
  const originalData = [
    {
      projectName: '这是项目名称这是项目名称这是项目名称这是项目名称',
      taskOwer: '冯腾飞',
      startTime: '2024-11-29',
      endTime: '2024-12-29',
      projectDataMap: {
        '2024-11-01': {
          sj: 'delay',
          jh: 'plan',
          isToday: false
        },
        '2024-11-13': {
          sj: 'delay',
          jh: 'plan',
          isToday: true
        }
      }
    },
    {
      projectName: '项目名称',
      taskOwer: '王泽',
      startTime: '2024-11-21',
      endTime: '2024-12-11',
      projectDataMap: {
        '2024-11-01': {
          sj: 'delay',
          jh: 'plan',
          isToday: false
        },
        '2024-11-13': {
          sj: 'delay',
          jh: 'plan',
          isToday: true
        }
      }
    }
  ];

  // 格式化函数
  const formattedData = originalData.map(item => {
    const { projectDataMap, ...rest } = item;  // 分离出 projectDataMap 和其他字段
    return {
      ...rest,  // 保留其他字段
      ...projectDataMap  // 将 projectDataMap 展开为直接字段
    };
  });

  console.log(formattedData);

</script>
</body>
</html>